﻿

//运筹帷幄  em_ycww.html ycww
//获得个股要闻表单
$("#bt_em_ycww_adddailystock").click(function () {
    var strHtml = "";
    if ($("#ycww_code1").val() == '') {
        alert("请填写指数代码!");
        return false;
    }
    if ($("#ycww_code2").val() == '') {
        alert("请填写指数代码!");
        return false;
    }
    $.get("eGold.ashx", { action: "AddDailyStock", code1: $("#ycww_code1").val(), code2: $("#ycww_code2").val() },
                   function (data) {
                       $(window.frames["xhe0_iframe"].document).find('body').append(data);
                   });
});


//板块掘金  em_bkjj.html bkjj
//获得板块掘金模版
$("#bt_em_bkjj_model").click(function () {
    var strHtml = "";
    strHtml += "<div class=\"mc_cnt\"  id='em_bkjj'  colname='em_bkjj'>";
    strHtml += "<div class=\"mc_txt\">";
    strHtml += "";
    strHtml += "<h2 class=\"hc\" ><div ptype=\"colinfo_key\">此处填写标题</div></h2></p>";
    strHtml += "";
    strHtml += "从此处开始填写正文";
    strHtml += "</div>";
    strHtml += "</div>";
    $(window.frames["xhe0_iframe"].document).find('body').append(strHtml);
});




//大势图解  em_dstj.html dstj
$("#bt_em_dstj_model").click(function () {
    var strHtml = "";
    $.get("eGold.ashx", { action: "AddDSTJ" },
                   function (data) {
                       $(window.frames["xhe0_iframe"].document).find('body').append(data);
                   });
               });



 //板块资金  em_bkzj
$("#bt_em_bkzj_model").click(function () {

    var strHtml = "<br /><br />";
    var d = new Date();
    var month = d.getMonth() + 1;
    var day = d.getDate();
  
    if (month < 10) { month = "0" + String(month); }
    if (day < 10) { day = "0" + String(day); }
    var strdate = String(d.getFullYear()) + month + day;
    strHtml += "<div class=\"mc_cnt\">";
    strHtml += "<div class=\"mc_txt\">";
    strHtml += "<div class='img_0 img_1' style='width:413px;'>";
    strHtml += '<div class="imgtb">';
    strHtml += '<div class="h">';
    strHtml += ' <h2>当日板块资金流入前10名(单位:亿元)</h2><div class="h_r"></div> </div>';
    strHtml += ' <div class="it_b"><img src='+imgpath+  'bk_down.png width="403" height="239" class="img_0" /></div>';
    strHtml += "</div>";
    strHtml += "</div>";   //class='img_0 img_1' end
    strHtml += "<p>请在此处填写正文";
    strHtml += '<div class="clr"></div>';
    strHtml += "</div>";   //end mc_txt

    strHtml += "<div class=\"mc_txt\">";
    strHtml += "<div class='img_0 img_1' style='width:413px;'>";
    strHtml += '<div class="imgtb">';
    strHtml += '<div class="h">';
    strHtml += ' <h2>当日板块资金流出前10名(单位:亿元)</h2><div class="h_r"></div> </div>';
    strHtml += " <div class='it_b'><img src="+imgpath + "bk_up.png width='403' height='239' class='img_0' /></div>";
    strHtml += "</div>";
    strHtml += "</div>";   //class='img_0 img_1' end
    strHtml += "<p>请在此处填写正文";
    strHtml += '<div class="clr"></div>';
    strHtml += "</div>"; //end mc_txt
    strHtml += "</div>";   //end mc_cnt
    $(window.frames["xhe0_iframe"].document).find('body').append(strHtml);
});


//个股资金 ggzj
$("#bt_em_ggzj_getgg").click(function () {
    var strHtml = "";
    $.get("eGold.ashx", { action: "GetGGZJ" },
                   function (data) {
                       $(window.frames["xhe0_iframe"].document).find('body').append(data);
                   });
               });
function GetGGZJList() {
    var strHtml = "";
    $.get("eGold.ashx", { action: "GetGGZJ" },
    function (data) {
        $(window.frames["xhe0_iframe"].document).find('body').append(data);
    });
               
}


//异动点评
$("#bt_em_yddp_getgg").click(function () {
    var strHtml = "";
    $.get("eGold.ashx", { action: "GetYDDP" },
    function (data) {
        $(window.frames["xhe0_iframe"].document).find('body').append(data);
    });
});
function GetYDDPList() {
    var strHtml = "";
    $.get("eGold.ashx", { action: "GetYDDP" },
    function (data) {
        $(window.frames["xhe0_iframe"].document).find('body').append(data);
    });

}


//新增潜力掘金
$("#bt_em_qljj_addgg").click(function () {

    var strHtml;
    var code = $('#goodscode').val();
    AddGoodsInfo("em_qljj", code);
});

//删除潜力掘金
$("#bt_em_qljj_deletegg").click(function () {
    var code = $('#goodscode').val();
    $(window.frames["xhe0_iframe"].document).find('div').remove("#em_qljj_" + code);
});

//图解天下模版
$("#bt_em_tjtx_model").click(function () {
    var strHtml = "";
    $.get("eGold.ashx", { action: "AddTJTX" },
                   function (data) {
                       $(window.frames["xhe0_iframe"].document).find('body').append(data);
                   });
});


//图解天下图片模版  bt_em_tjtx_addimg
$("#bt_em_tjtx_addimg").click(function () {

    var strHtml = "<br /><br />";
    var d = new Date();
    var month = d.getMonth() + 1;
    var day = d.getDate();

    if (month < 10) { month = "0" + String(month); }
    if (day < 10) { day = "0" + String(day); }
    var strdate = String(d.getFullYear()) + month + day;
    strHtml += "<div class=\"mc_cnt\">";
    strHtml += "<div class=\"mc_txt\">";
    strHtml += "<div class='img_0 img_1' style='width:413px;'>";
    strHtml += '<div class="imgtb">';
    strHtml += '<div class="h">';
    strHtml += ' <h2>一周板块资金流向排名(单位:亿元)</h2><div class="h_r"></div> </div>';
    strHtml += ' <div class="it_b"><img src=' + imgpath + 'lx_bk.png width="403" height="239" class="img_0" /></div>';
    strHtml += "</div>";
    strHtml += "</div>";   //class='img_0 img_1' end
    strHtml += "<p>请在此处填写正文";
    strHtml += '<div class="clr"></div>';
    strHtml += "</div>";   //end mc_txt

    strHtml += "<div class=\"mc_txt\">";
    strHtml += "<div class='img_0 img_1' style='width:413px;'>";
    strHtml += '<div class="imgtb">';
    strHtml += '<div class="h">';
    strHtml += ' <h2>一周个股资金流向排名(单位:亿元)</h2><div class="h_r"></div> </div>';
    strHtml += " <div class='it_b'><img src=" + imgpath + "lx_gg.png width='403' height='239' class='img_0' /></div>";
    strHtml += "</div>";
    strHtml += "</div>";   //class='img_0 img_1' end
    strHtml += "<p>请在此处填写正文";
    strHtml += '<div class="clr"></div>';
    strHtml += "</div>"; //end mc_txt
    strHtml += "</div>";   //end mc_cnt
    $(window.frames["xhe0_iframe"].document).find('body').append(strHtml);
});


//新增黑马解密
  $("#bt_em_hmjm_addgg").click(function () {

    var strHtml;
    var code = $('#goodscode').val();
    AddHmjmGoodsInfo("em_hmjm", code);
});
//删除黑马解密
$("#bt_em_hmjm_deletegg").click(function () {
    var code = $('#goodscode').val();
    $(window.frames["xhe0_iframe"].document).find('div').remove("#em_hmjm_" + code);
               });



//新增快马一鞭
$("#bt_em_kmyb_addgg").click(function () {

    var strHtml;
    var code = $('#goodscode').val();
    AddGoodsInfo("em_kmyb", code);
});
//删除快马一鞭
$("#bt_em_kmyb_deletegg").click(function () {
    var code = $('#goodscode').val();
    $(window.frames["xhe0_iframe"].document).find('div').remove("#em_kmyb_" + code);
});


//新增研报淘金
$("#bt_em_ybtj_model").click(function () {
    var key = $("#keyword").val();
    if (key == '') {
        alert('请填写标题！');
        return false;
    }
    var strHtml = '';
    strHtml += "<div class=\"mc_cnt\"   colname='em_ybtj'>";
    strHtml += "<div class=\"mc_txt\">";
    strHtml += "<div ptype=\"colinfo_key\">";
    strHtml += key;
    strHtml += "</div>" + "<p>";
    strHtml += "从此处开始填写正文";
    strHtml += "</div>";
    strHtml += "</div>";
    $(window.frames["xhe0_iframe"].document).find('body').append(strHtml);
});

//新增价值洼地
$("#bt_em_jzwd_addjzwd").click(function () {
    var key = $("#keyword").val();
    if (key == '') {
        alert('请填写标题！');
        return false;
    }
    var strHtml = '';
    strHtml += "<div class=\"mc_cnt\"   colname='em_jzwd'>";
    strHtml += "<div class=\"mc_txt\">";
    strHtml += "<h2 class=\"hc\"><div ptype=\"colinfo_key\">";
    strHtml += key;
    strHtml += "</div></h2>" + "<p>";
    strHtml += "从此处开始填写正文";
    strHtml += "</div>";
    strHtml += "</div>";
    $(window.frames["xhe0_iframe"].document).find('body').append(strHtml);
});





//增加个股信息 , colname colinfo会入库
function AddGoodsInfo(column, code) {
    var strHtml = "";
    $.get("eGold.ashx", { action: "AddGoodsInfo", column: column, code: code },
    function (data) {
        strHtml += "";
        strHtml += '<div class="mc_cnt" id="' + column + '_' + code + '"  colname="' + column + '">';
        strHtml += '<div class="mc_txt" >';
        if (code != "") {
            strHtml += '<h2 class="hb"><div  ptype="colinfo_key">';
            strHtml +=  GetCodeName(code) +'  '+code ;
            strHtml += '</div></h2>';
        }
        strHtml += '<p>请在此处填写正文</p>';
        strHtml += '</div>';
        strHtml += '<div  class="mc_img"><img src="' + data + '" width="900" height="600" class="img_0" /></div>';

        strHtml += '</div>';
        $(window.frames["xhe0_iframe"].document).find('body').append(strHtml);
    });
}

//通过股票代码获得股票名称
function GetCodeName(code) {
    var strReturn = '';
    for (var i = 0; i < EALists.length; i++) {
        if (EALists[i]["_R"] == code) {
            strReturn = EALists[i]["_N"];
            break;
        }
    }
    return strReturn;
}


//增加黑马解密 , colname colinfo会入库
function AddHmjmGoodsInfo(column, code) {
    var strHtml = "";
    $.get("eGold.ashx", { action: "AddHmjmGoodsInfo", column: column, code: code },
    function (data) {
        strHtml += "";
        strHtml += '<div class="mc_cnt" id="' + column + '_' + code + '"  colname="' + column + '">';
        strHtml += '<div class="mc_txt" >';
        if (code != "") {
            strHtml += '<h2 class="hb" ><div ptype="colinfo_key">';
            strHtml += GetCodeName(code)+ ' ' +code ;
            strHtml += '</div></h2>';
        }
        strHtml += '<p>请在此处填写正文</p>';
        strHtml += '</div>';
        strHtml += '<div  class="mc_img"><img src="' + data + '" width="900" height="600" class="img_0" /></div>';
        strHtml += '<p>请在此处填写正文</p>';
        strHtml += '</div>';
        $(window.frames["xhe0_iframe"].document).find('body').append(strHtml);
    });
}


              

